#ifndef AVALON_WRITER_HPP
#define AVALON_WRITER_HPP
#include "Avalon/IO/IO.hpp"
#include "Avalon/Threading/Async.hpp"

namespace Avalon {
namespace IO {

  /*! \class Writer
   *  \brief Interface for writing data to a resource.
   *  \author Kamal Mansouri <kranar@hotmail.com>
   */
  class Writer {
    public:

      virtual ~Writer();

      //! Writes data to the resource.
      /*!
        \param data The data to write.
        \param size The size of the data.
      */
      virtual Threading::Async<void>::Ptr Write(const void* data,
        int size) = 0;

      //! Writes data to the resource.
      /*!
        \param data The data to write.
      */
      virtual Threading::Async<void>::Ptr Write(const Buffer& data) = 0;
  };
}
}

#endif // AVALON_WRITER_HPP
